package pers.cocoadel.springcloud.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.web.bind.annotation.*;
import pers.cocoadel.springcloud.entities.CommonResult;
import pers.cocoadel.springcloud.entities.Payment;
import pers.cocoadel.springcloud.service.PaymentService;

import static org.springframework.http.HttpMethod.GET;


/**
 * @author rwby
 */
@RestController
@RequestMapping("/consumer")
public class OrderController
{
    private final PaymentService paymentService;

    @Autowired(required = false)
    public OrderController(PaymentService paymentService)
    {

        this.paymentService = paymentService;
    }

    @GetMapping("/payment/get/{id}")
    public CommonResult<Payment> getById(@PathVariable("id") Long id)
    {
        return paymentService.getById(id);
    }

    @GetMapping("/payment/feign/time_out")
    public String getPaymentTimeOut()
    {
        return paymentService.getPaymentTimeOut();
    }
}
